home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-02-01 | 1.9 KB | 102 lines | [TEXT/MPCC] |
-
- //============================================================================
- //----------------------------------------------------------------------------
- // Glypha III 1.0.1
- // by Scheherazade
- //----------------------------------------------------------------------------
- //============================================================================
-
-
- #include "Externs.h"
- #include <Sound.h>
-
-
- #define kPrefsVersion 0x0001
-
-
- void ReadInPrefs (void);
- void WriteOutPrefs (void);
- void main (void);
-
-
- prefsInfo thePrefs;
- short wasVolume;
-
- extern Boolean quitting, playing, pausing, evenFrame;
-
-
- //============================================================== Functions
- //-------------------------------------------------------------- ReadInPrefs
-
- void ReadInPrefs (void)
- {
- short i;
-
- if (LoadPrefs(&thePrefs, kPrefsVersion))
- SetSoundVol(thePrefs.wasVolume);
- else
- {
- thePrefs.prefVersion = kPrefsVersion;
- thePrefs.filler = 0;
- PasStringCopy("\pYour Name", thePrefs.highName);
- for (i = 0; i < 10; i++)
- {
- PasStringCopy("\pNemo", thePrefs.highNames[i]);
- thePrefs.highScores[i] = 0L;
- thePrefs.highLevel[i] = 0;
- }
- GetSoundVol(&thePrefs.wasVolume);
- }
-
- GetSoundVol(&wasVolume);
- }
-
- //-------------------------------------------------------------- WriteOutPrefs
-
- void WriteOutPrefs (void)
- {
- if (!SavePrefs(&thePrefs, kPrefsVersion))
- SysBeep(1);
- SetSoundVol(wasVolume);
- }
-
- //-------------------------------------------------------------- main
-
- void main (void)
- {
- long tickWait;
-
- ToolBoxInit();
- CheckEnvirons();
- OpenMainWindow();
- InitVariables();
- InitSound();
- InitMenubar();
- ReadInPrefs();
-
- do
- {
- // DoIdleAnimation();
- HandleEvent();
- if ((playing) && (!pausing))
- PlayGame();
- else
- {
- tickWait = TickCount() + 2L;
- evenFrame = !evenFrame;
- DrawTorches();
- CopyAllRects();
- do
- {
- }
- while (TickCount() < tickWait);
- }
- }
- while (!quitting);
-
- KillSound();
- ShutItDown();
- WriteOutPrefs();
- }
-
-